class Book {
    constructor(book) {
        this.tr = document.createElement("tr");
        function createProperty(value){
            let td = document.createElement("td");
            td.textContent = value;
            return td;
        }
        this.tr.appendChild(createProperty(book.id));
        this.tr.appendChild(createProperty(book.name));
        this.tr.appendChild(createProperty(book.price));
        this.tr.appendChild(createProperty(book.publisher));
        this.tr.appendChild(createProperty(book.inventory));
        this.tr.appendChild(createProperty(book.createTime));
        this.tr.appendChild(createProperty(book.updateTime));
        this.tr.appendChild(createProperty(book.status));
    }



    appendTo(parent) {
        parent.appendChild(this.tr);
    }
}